
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <%@ include file="../include/css.jsp" %>

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="content-wrapper">

    <!-- Main content -->
    <section class="content">

        <!-- Default box -->
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">编辑用户</h3>

                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="backBtn">
                        <i class="fa fa-plus"></i> 返回列表
                    </button>
                </div>
            </div>


            <div class="box-body">
                <form action="/user/update"  id="saveForm" method="post" enctype="multipart/form-data">
                    <span>${errorMessage}</span>
                    <div class="form-group">
                        <input type="text" name="id" class="form-control" type="hidden" value="${user.id}">
                        <label>姓名</label>
                        <input type="text" name="name" class="form-control" value="${user.name}">
                    </div>
                    <div class="form-group">
                        <label>手机号</label>
                        <input type="text" name="mobile" class="form-control" value="${user.mobile}">
                    </div>
                    <div class="form-group">
                        <label>原密码</label>
                        <input type="password" name="oldPassword" class="form-control" id="oldPassword">
                    </div>
                    <div class="form-group">
                        <label>密码</label>
                        <input type="password" name="password" class="form-control" id="password">
                    </div>
                    <div class="form-group">
                        <label>密码</label>
                        <input type="password" name="password1" class="form-control" id="password1">
                    </div>
                    <div class="form-group">
                        <label>权限</label>
                        <input type="text" name="permissions" class="form-control" value="${user.permissions}" >
                    </div>
                    <button class="btn btn-primary" id="saveBtn">保存</button>
                </form>
            </div>



        </div>
        <!-- /.box -->

    </section>
    <!-- /.content -->
</div>

<script
        src="https://code.jquery.com/jquery-2.2.4.min.js"
        integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
        crossorigin="anonymous"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<%@ include file="../include/js.jsp"%>
<script>
    $(function () {
        $("#backBtn").click(function () {
            window.location.href="/user/all"
        })
    })
</script>
</body>
</html>